const mongoose = require('mongoose');
//会员信息表中的字段
//  编号member_id、会员姓名member_name、会员等级member_level、充值金额money、消费折扣 discount、余额 remaining_sum
// 余额 = 充值金额 - 消费金额 * 折扣
const memberInfoSchema = new mongoose.Schema({
    member_id: {
        type: String,
        unique: true,
        required: true
    },
    member_name: {
        type: String,
        required: true
    },
    member_level: {
        type: String,
        required: true
    },
    money: {
        type: Number,
        required: true
    },
    discount: {
        type: Number,
        required: true
    },
    remaining_sum: {
        type: Number,
        required: true
    }
});
module.exports = mongoose.model('memberinfos', memberInfoSchema);